package per.hx.bs.utils;

import org.apache.shiro.SecurityUtils;
import org.apache.shiro.subject.Subject;
import per.hx.bs.shiro.ShiroUser;

/**
 * @author HuXing
 * @date 2018/3/26  16:46
 */
public class BscLogUtils {

    private static Subject getSubjct() {
        return SecurityUtils.getSubject();
    }

    public static ShiroUser getUser() {
        Object object = getSubjct().getPrincipal();
        return (ShiroUser) object;
    }

    public static Long getUserId() {
        return getUser().getUserId();
    }
}
